package code.adapter.jackAdapter03;

public class AdapterTest01 {
    public static void main(String[] args) {
        Adapter adapter = new Adapter(new Adaptee());
        int i = adapter.output5v();
        System.out.println( "5v" + i );

    }
}

class Adaptee{
    public int output220v(){
        return 220;
    }
}

interface Target{
    int output5v();
}

class Adapter implements  Target{

    private Adaptee adaptee;

    public Adapter(Adaptee adaptee) {
        this.adaptee = adaptee;
    }


    public int output5v() {
        int i = adaptee.output220v();

        System.out.println(String.format("原始电压 ： %dv  ->  输出电压 ： %dv " , i , 5));
        return 5;
    }
}